CMAKE_BIN=$HOME/cmake-3.31.2-linux-x86_64/bin

cd abseil-cpp
mkdir build
${CMAKE_BIN}/cmake	 -S . -B build -D CMAKE_INSTALL_PREFIX=/opt/apollo/absl
make -C build -j4
sudo make install -C build
cd ../pytorch
git submodule update --init --recursive
mkdir build
${CMAKE_BIN}/cmake	 -S . -B build  -DUSE_CUDA=ON -DCMAKE_INSTALL_PREFIX=/usr/local/libtorch_gpu/
make -C build -j4
sudo make install -C build
cmake	 -S . -B build  -DUSE_CUDA=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/libtorch_cpu/
make -C build -j4
sudo make install -C build

cd ../foonathan_memory_vendor
mkdir build
${CMAKE_BIN}/cmake	 -S . -B build 
make -C build -j4
sudo make install -C build
cd ../Fast-CDR
mkdir build
${CMAKE_BIN}/cmake	 -S . -B build 
make -C build -j4
sudo make install -C build
cd ../Fast-DDS
mkdir build
git checkout origin/2.9.2
${CMAKE_BIN}/cmake	 -S . -B build 
make -C build -j4
sudo make install -C build
cd ../Fast-RTPS
mkdir build
${CMAKE_BIN}/cmake	 -S . -B build 
make -C build -j4
sudo make install -C build
cd ../osqp
mkdir build
origin/release-0.6.3
${CMAKE_BIN}/cmake	 -S . -B build 
make -C build -j4
sudo make install -C build
cd ../Proj4
mkdir build
${CMAKE_BIN}/cmake	 -S . -B build -DCMAKE_INSTALL_PREFIX=/opt/apollo/proj
make -C build -j4
sudo make install -C build

cd ../brpc
bazel build //:bvar //:butil //:config_h
cd ..
